package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class GoAvChatMethods extends BaseMethods {

    private static GoAvChatMethods m_ins = null;

    public static GoAvChatMethods getInstance() {
        if (m_ins == null) {
            synchronized (GoAvChatMethods.class) {
                if (m_ins == null) {
                    m_ins = new GoAvChatMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "VideoChat/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void videoChat(Subscriber<Object> subscriber,
                      int uid,
                      String fid  ) {
        Observable observable = initService().videoChat(System.currentTimeMillis()+"",
                "8c1fd212a3867703a1f4574138c1867b",uid,fid
        );
        toSubscribe(observable, subscriber);
    }
}
